package com.jgp.sys.ui;

import com.jgp.sys.ui.model.Field;
import com.jgp.sys.ui.model.Form;
import com.jgp.sys.ui.model.Group;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/**
 * 项目   sys
 * 作者   loufei
 * 时间   2018/3/10
 */
public class FormResult {
    private Form form;
    private Group group;
    private List<Field> fields;

    public Form getForm() {
        return form;
    }

    public void setForm(Form form) {
        this.form = form;
    }

    public Group getGroup() {
        return group;
    }

    public void setGroup(Group group) {
        this.group = group;
    }

    public List<Field> getFields() {
        return fields;
    }
    
    public FormResult addFields(List<Field> fields){
        if(Objects.isNull(this.fields)){
            this.fields = new ArrayList<>();
        }
        this.fields.addAll(fields);
        return this;
    }
}
